<?php
//模块插件类
//插件功能类，由系统调用，实现具体功能。
defined('BY_JYA') or exit('error');
class core_jy_weishop_food extends plugin{
	public function __construct($name){
		global $_RQ;
		parent::__construct($name);
		set_exi(function($message,$type='success',$action='',$url=''){
			if(is_array($message) && !isset($message[0])){
				$message['setting']=$this->plugin_setting('setting');
				$message['shopset']=$this->plugin_setting('shopset');
			}
			exi($message,$type,$action,$url);
		});
	}
	public function array_sort($arr , $keys , $type = 'asc') {
        $keysvalue = $new_array = array();
        foreach ($arr as $k => $v) {
            $keysvalue[$k] = $v[$keys];
        }
        if ($type == 'asc') {
            asort($keysvalue);
        } else {
            arsort($keysvalue);
        }
        reset($keysvalue);
        foreach ($keysvalue as $k => $v) {
            $new_array[$k] = $arr[$k];
        }
        return $new_array;
    }
}
?>